<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>用户登录与注册</title>
  <style>
    .error { color: red; }
    .success { color: green; }
  </style>
</head>
<body>
<h2>用户登录</h2>

<div th:if="${param.error}" class="error">
  <p>账号或密码错误，请重试！</p>
</div>

<div th:if="${param.logout}" class="success">
  <p>您已成功退出。</p>
</div>

<form method="post" th:action="@{/login}">
  <p>用户名: <input type="text" name="username" required></p>
  <p>密码: <input type="password" name="password" required></p>
  <p><input type="submit" value="登录"></p>
</form>

<hr/>

<h2>新用户注册</h2>
<p>如果你还没有账号，请点击注册。</p>
<button onclick="window.location.href='/register'">注册</button>
</body>
</html>